<template>
	<navigator @click="to" class="newsListItem">
		<view class="newsListItem_title">
			{{news.title}}
		</view>
		<view class="newsListItem_brief">
			{{brief}}>>>点击查看更多
		</view>
	</navigator>
</template>

<script>
	export default{
		props:{
			news:{
				type:Object
			}
		},
		data(){
			return{
				
			}
		},
		computed:{
			brief(){
				return this.news.context.substring(0,100)
			}
		},
		methods:{
			to(){
				let vueComponents = this
				uni.navigateTo({
					url: `/packageC/pages/newsDetail/newsDetail?title=${vueComponents.news.title}&context=${vueComponents.news.context}`
				});
			}
		}
	}
</script>

<style lang="less">
	.newsListItem{
		width: 97%;
		background-color: #fff;
		margin: 1rem auto;
		box-sizing: border-box;
		padding: .8rem;
		border-radius: .5rem;
		.newsListItem_title{
			font-size: 1.2rem;
		}
		.newsListItem_brief{
			font-size: .8rem;
			color: #666;
		}
	}
</style>